@model OrchardCore.ContentFields.ViewModels.EditNumericFieldViewModel
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using OrchardCore
@using OrchardCore.ContentFields.Settings
@using OrchardCore.ContentManagement.Metadata.Models
@{
    var settings = Model.PartFieldDefinition.GetSettings<NumericFieldSettings>();
    string name = Model.PartFieldDefinition.DisplayName();
    decimal min = settings.Minimum.HasValue ? settings.Minimum.Value : 0;
    decimal max = settings.Maximum.HasValue ? settings.Maximum.Value : 10000;
}

<div class="@Orchard.GetFieldWrapperClasses(Model.PartFieldDefinition)" id="@Html.IdFor(x => x.Value)_FieldWrapper">
    <label asp-for="Value" class="@Orchard.GetLabelClasses(inputRequired: settings.Required)">@name</label>
    <div class="@Orchard.GetEndClasses()">
        <div class="@Orchard.GetLimitedWidthWrapperClasses()">
            <div class="@Orchard.GetLimitedWidthClasses()">
                <div class="input-group">
                    @if (settings.Minimum.HasValue)
                    {
                        <span class="input-group-text">@min</span>
                    }
                    <strong>@(Model.Value ?? T["<empty>"].Value)</strong>
                    @if (settings.Maximum.HasValue)
                    {
                        <span class="input-group-text">@max</span>
                    }
                </div>
                <input hidden asp-for="Value" />
                <span asp-validation-for="Value"></span>
            </div>
        </div>
        @if (!string.IsNullOrEmpty(settings.Hint))
        {
            <span class="hint">@settings.Hint</span>
        }
    </div>
</div>
